package com.bytech.common.biz.entity.articleTag;

import java.util.Date;

import com.bytech.common.biz.enums.CommonStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author Zhao
 * @Create 2021/8/13 15:21
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class ArticleTagDto extends ArticleTag {

    private static final long serialVersionUID = 1L;

    public void init() {
        super.setCreateTime(new Date());
    }

    public CommonStatusEnum getStatusEnum() {
        return CommonStatusEnum.of(getTagStatus());
    }

    public boolean isNormal() {
        return CommonStatusEnum.NORMAL.equals(getStatusEnum());
    }

    public boolean isDeleted() {
        return CommonStatusEnum.DELETED.equals(getStatusEnum());
    }

    public String getTagStatusDesc() {
        return CommonStatusEnum.of(getTagStatus()).getDesc();
    }
}
